package com.luoxin.apipassenger.controller;

import com.luoxin.apipassenger.service.UserService;
import com.luoxin.internalcommon.constant.CommonStatusEnum;
import com.luoxin.internalcommon.dto.ResponseResult;
import com.luoxin.internalcommon.dto.TokenResult;
import com.luoxin.internalcommon.util.JwtUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
public class UserController {
    @Autowired
    private UserService userService;
    @GetMapping("/users")
    public ResponseResult getUser(HttpServletRequest  request) {
        String authorization = request.getHeader("Authorization");
        return userService.getUserByAccessToken(authorization);
    }
}
